package com.springvue.springvue.controller;

import com.springvue.springvue.config.JsonResult;

import com.springvue.springvue.entity.Userfan;
import com.springvue.springvue.service.UserSevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController

@RequestMapping(value = "/user")
public class User {
    @Autowired
    private UserSevice userSevice;
    @GetMapping("/geuser")
   public String  getUser(){
        return "我来了啊修改了";
    }

    @GetMapping("/getList")
    public List<String> getList(){
        List<String> user =new ArrayList<String>();
        user.add("wo zaixiug");
        user.add("上海交大财经大学额");
        return user;
    }

    //查询数据库的全部
    @GetMapping("/getAll")
    public JsonResult<List> getAll(){
        List resData=userSevice.findAll();
       return new JsonResult<>(resData);
    }

}